<@layout.extends name="layout/template.ftl">
	<@layout.put block="title">机构管理</@layout.put>

	<@layout.put block="contents">

<!-- content starts -->
<div>
    <ul class="breadcrumb">
        <li>
            <a href="#">后台管理</a>
        </li>
        <li>
            <a href="#">系统管理</a>
        </li>
        <li>
            <a href="${request.contextPath}/sys/office">机构管理</a>
        </li>
    </ul>
</div>

<div class="row">
	<div class="box col-md-12">
		<div class="box col-md-3">
			<div class="box-inner">
				<div class="box-content">
					<ul id="officeTree" class="ztree"></ul>
				</div>
			</div>
		</div>
		<div class="box col-md-9">
			表格
		</div>
	</div>
</div>




<script type="text/javascript" charset="utf-8">

	var setting = {
		data: {
			pIdKey: "parentId",
		},
		async: {
			enable: true,
			type: "get",
			dataFilter: filter,
			url:"${request.contextPath}/sys/office/select-by-parent-id",
			autoParam:["id=parentId"]
		}
	};


	var zNodes =[
		{ id:0, parentId:null, name:"机构部门",isParent:true,open:true}
	];
	
	function filter (treeId, parentNode, responseData){
		if (responseData.success) {
			return responseData.data;
		}
	}

$(document).ready(function() {
	$.fn.zTree.init($("#officeTree"), setting, zNodes);
	var treeObj = $.fn.zTree.getZTreeObj("officeTree");
	treeObj.reAsyncChildNodes(treeObj.getNodes()[0], "refresh", false);
});
</script>

	</@layout.put>
</@layout.extends>


